package com.zodiac.alioth.service.impl;

import cn.hutool.core.util.ObjectUtil;
import com.zodiac.alioth.common.api.annotation.ApiMapping;
import com.zodiac.alioth.common.model.vo.ApiResponse;
import com.zodiac.alioth.dal.mapper.NavDetailDOMapper;
import com.zodiac.alioth.dal.model.NavDetailDO;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class NavServiceImpl {

    @Resource
    private NavDetailDOMapper navDetailDOMapper;

    @ApiMapping(apiName = "nav.list", apiVersion = "0.1")
    public ApiResponse<List<NavDetailDO>> getNavDetailList(Long id, Long count) {
        id = ObjectUtil.isEmpty(id) ? 0L : id;
        count = ObjectUtil.isEmpty(count) ? 100L : count;
        List<NavDetailDO> navDetailDOS = navDetailDOMapper.selectList(id, count);
        return ApiResponse.getSuccessResult(navDetailDOS);
    }

}
